
package robotinterface.list.entry;

import java.io.Serializable;
import javax.swing.ImageIcon;

/**
 *
 * @author Brian Bailey
 */
public class Entry implements Serializable {

    private String title;
    private String toolTip;

    private ImageIcon image;
    private String imagePath;

    public Entry(String t)
    {
       title = t;
       setToolTip(t);
    }

    public Entry( String title, String imagePath )
    {
        this.title = title;
        this.imagePath = imagePath;
    }

    public String getTitle()
    {
        return title;
    }

    public ImageIcon getImage() {
        if (image == null)
        {
            image = new ImageIcon(imagePath);
        }
        return image;
    }

    public String getToolTip()
    {
        return toolTip;
    }

    private void setToolTip(String toolTip)
    {
        this.toolTip = "<html>"+ "Item" +"<br>"+title+"</html>";
        //this.toolTip = toolTip;
    }

    @Override
    public String toString()
    {
        return title;
    }

}
